/*
 * Copyright (c) 2021. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
 * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
 * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
 * Vestibulum commodo. Ut rhoncus gravida arcu.
 */

/**
 * 输出99乘法表
 */
public class HomeWork0312406 {

    public static void main(String[] args) {
        for(int row=1;row<=9;row++){
            for (int col=1;col<=row;col++){
                System.out.format("%s*%s=%-3s",col,row,col*row);
            }
            System.out.println();
        }

        print99(1,1);//1,1 初始化

    }

    public static void print99(int row,int col){
        if(col>row){
            col=1;
            row++;
            System.out.println();
        }

        if(row>9){//结束条件
            return;
        }

        System.out.format("%s*%s=%-3s",col,row,col*row);
        print99(row,col+1);//方法的递归调用 col+1:变化
    }
}
